package to;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "productTO", propOrder = {
    "cuttingDate",
    "cuttingId",
    "cuttingQuality",
    "cuttingTime",
    "dyeingDate",
    "dyeingId",
    "dyeingQuality",
    "dyeingTime",
    "finished",
    "order",
    "orderId",
    "outcome",
    "pressingDate",
    "pressingId",
    "pressingQuality",
    "pressingTime",
    "productId",
    "sewingDate",
    "sewingId",
    "sewingQuality",
    "sewingTime"
})
@XmlRootElement(name="product")
public class ProductTO implements Serializable{
	
	@XmlElement(required = false)
	private int productId;
	@XmlElement(required = false)
	private int orderId;
	@XmlElement(required = false)
	private OrderTO order;
	@XmlElement(required = false)
	private String cuttingId;
	@XmlElement(required = false)
	private String sewingId;
	@XmlElement(required = false)
	private String dyeingId;
	@XmlElement(required = false)
	private String pressingId;
	@XmlElement(required = false)
	private int cuttingQuality;
	@XmlElement(required = false)
	private int sewingQuality;
	@XmlElement(required = false)
	private int dyeingQuality;
	@XmlElement(required = false)
	private int pressingQuality;
	@XmlElement(required = false)
	private int cuttingTime;
	@XmlElement(required = false)
	private int sewingTime;
	@XmlElement(required = false)
	private int dyeingTime;
	@XmlElement(required = false)
	private int pressingTime;
	@XmlElement(required = false)
	private String cuttingDate;
	@XmlElement(required = false)
	private String sewingDate;
	@XmlElement(required = false)
	private String dyeingDate;
	@XmlElement(required = false)
	private String pressingDate;
	@XmlElement(required = false)
	private String finished;
	@XmlElement(required = false)
	private OutcomeTO outcome;
	
	public ProductTO (){}
	
	public ProductTO(int productId, int orderId, OrderTO order,
			String cuttingId, String sewingId, String dyeingId,
			String pressingId, int cuttingQuality, int sewingQuality,
			int dyeingQuality, int pressingQuality, int cuttingTime,
			int sewingTime, int dyeingTime, int pressingTime,
			String cuttingDate, String sewingDate, String dyeingDate,
			String pressingDate, String finished, OutcomeTO outcome) {
		super();
		this.productId = productId;
		this.orderId = orderId;
		this.order = order;
		this.cuttingId = cuttingId;
		this.sewingId = sewingId;
		this.dyeingId = dyeingId;
		this.pressingId = pressingId;
		this.cuttingQuality = cuttingQuality;
		this.sewingQuality = sewingQuality;
		this.dyeingQuality = dyeingQuality;
		this.pressingQuality = pressingQuality;
		this.cuttingTime = cuttingTime;
		this.sewingTime = sewingTime;
		this.dyeingTime = dyeingTime;
		this.pressingTime = pressingTime;
		this.cuttingDate = cuttingDate;
		this.sewingDate = sewingDate;
		this.dyeingDate = dyeingDate;
		this.pressingDate = pressingDate;
		this.finished = finished;
		this.outcome = outcome;
	}
	
	public ProductTO(int productId, int orderId, OrderTO order,
			String cuttingId, String sewingId, String dyeingId,
			String pressingId, int cuttingQuality, int sewingQuality,
			int dyeingQuality, int pressingQuality, int cuttingTime,
			int sewingTime, int dyeingTime, int pressingTime,
			String cuttingDate, String sewingDate, String dyeingDate,
			String pressingDate, String finished) {
		super();
		this.productId = productId;
		this.orderId = orderId;
		this.order = order;
		this.cuttingId = cuttingId;
		this.sewingId = sewingId;
		this.dyeingId = dyeingId;
		this.pressingId = pressingId;
		this.cuttingQuality = cuttingQuality;
		this.sewingQuality = sewingQuality;
		this.dyeingQuality = dyeingQuality;
		this.pressingQuality = pressingQuality;
		this.cuttingTime = cuttingTime;
		this.sewingTime = sewingTime;
		this.dyeingTime = dyeingTime;
		this.pressingTime = pressingTime;
		this.cuttingDate = cuttingDate;
		this.sewingDate = sewingDate;
		this.dyeingDate = dyeingDate;
		this.pressingDate = pressingDate;
		this.finished = finished;
	}
	
	public ProductTO(int productId, int orderId,
			String cuttingId, String sewingId, String dyeingId,
			String pressingId, int cuttingQuality, int sewingQuality,
			int dyeingQuality, int pressingQuality, int cuttingTime,
			int sewingTime, int dyeingTime, int pressingTime,
			String cuttingDate, String sewingDate, String dyeingDate,
			String pressingDate, String finished) {
		super();
		this.productId = productId;
		this.orderId = orderId;
		this.cuttingId = cuttingId;
		this.sewingId = sewingId;
		this.dyeingId = dyeingId;
		this.pressingId = pressingId;
		this.cuttingQuality = cuttingQuality;
		this.sewingQuality = sewingQuality;
		this.dyeingQuality = dyeingQuality;
		this.pressingQuality = pressingQuality;
		this.cuttingTime = cuttingTime;
		this.sewingTime = sewingTime;
		this.dyeingTime = dyeingTime;
		this.pressingTime = pressingTime;
		this.cuttingDate = cuttingDate;
		this.sewingDate = sewingDate;
		this.dyeingDate = dyeingDate;
		this.pressingDate = pressingDate;
		this.finished = finished;
	}
	
	public int getProductId() {
		return productId;
	}

	public void setProductId(int productId) {
		this.productId = productId;
	}

	public int getOrderId() {
		return orderId;
	}

	public void setOrderId(int orderId) {
		this.orderId = orderId;
	}

	public OrderTO getOrder() {
		return order;
	}

	public void setOrder(OrderTO order) {
		this.order = order;
	}

	public int getCuttingQuality() {
		return cuttingQuality;
	}

	public void setCuttingQuality(int cuttingQuality) {
		this.cuttingQuality = cuttingQuality;
	}

	public int getSewingQuality() {
		return sewingQuality;
	}

	public void setSewingQuality(int sewingQuality) {
		this.sewingQuality = sewingQuality;
	}

	public int getDyeingQuality() {
		return dyeingQuality;
	}

	public void setDyeingQuality(int dyeingQuality) {
		this.dyeingQuality = dyeingQuality;
	}

	public int getPressingQuality() {
		return pressingQuality;
	}

	public void setPressingQuality(int pressingQuality) {
		this.pressingQuality = pressingQuality;
	}


	public String getCuttingId() {
		return cuttingId;
	}

	public void setCuttingId(String cuttingId) {
		this.cuttingId = cuttingId;
	}

	public String getSewingId() {
		return sewingId;
	}

	public void setSewingId(String sewingId) {
		this.sewingId = sewingId;
	}

	public String getDyeingId() {
		return dyeingId;
	}

	public void setDyeingId(String dyeingId) {
		this.dyeingId = dyeingId;
	}

	public String getPressingId() {
		return pressingId;
	}

	public void setPressingId(String pressingId) {
		this.pressingId = pressingId;
	}

	public int getCuttingTime() {
		return cuttingTime;
	}

	public void setCuttingTime(int cuttingTime) {
		this.cuttingTime = cuttingTime;
	}

	public int getSewingTime() {
		return sewingTime;
	}

	public void setSewingTime(int sewingTime) {
		this.sewingTime = sewingTime;
	}

	public int getDyeingTime() {
		return dyeingTime;
	}

	public void setDyeingTime(int dyeingTime) {
		this.dyeingTime = dyeingTime;
	}

	public int getPressingTime() {
		return pressingTime;
	}

	public void setPressingTime(int pressingTime) {
		this.pressingTime = pressingTime;
	}

	public String getCuttingDate() {
		return cuttingDate;
	}

	public void setCuttingDate(String cuttingDate) {
		this.cuttingDate = cuttingDate;
	}

	public String getSewingDate() {
		return sewingDate;
	}

	public void setSewingDate(String sewingDate) {
		this.sewingDate = sewingDate;
	}

	public String getDyeingDate() {
		return dyeingDate;
	}

	public void setDyeingDate(String dyeingDate) {
		this.dyeingDate = dyeingDate;
	}

	public String getPressingDate() {
		return pressingDate;
	}

	public void setPressingDate(String pressingDate) {
		this.pressingDate = pressingDate;
	}

	
	public String getFinished() {
		return finished;
	}

	public void setFinished(String finished) {
		this.finished = finished;
	}

	public OutcomeTO getOutcome() {
		return outcome;
	}

	public void setOutcome(OutcomeTO outcome) {
		this.outcome = outcome;
	}

	@Override
	public String toString() {
		return "ProductTO [productId=" + productId + ", orderId=" + orderId
				+ ", order=" + order + ", cuttingId=" + cuttingId
				+ ", sewingId=" + sewingId + ", dyeingId=" + dyeingId
				+ ", pressingId=" + pressingId + ", cuttingQuality="
				+ cuttingQuality + ", sewingQuality=" + sewingQuality
				+ ", dyeingQuality=" + dyeingQuality + ", pressingQuality="
				+ pressingQuality + ", cuttingTime=" + cuttingTime
				+ ", sewingTime=" + sewingTime + ", dyeingTime=" + dyeingTime
				+ ", pressingTime=" + pressingTime + ", cuttingDate="
				+ cuttingDate + ", sewingDate=" + sewingDate + ", dyeingDate="
				+ dyeingDate + ", pressingDate=" + pressingDate + ", finished="
				+ finished + ", outcome=" + outcome + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((cuttingDate == null) ? 0 : cuttingDate.hashCode());
		result = prime * result
				+ ((cuttingId == null) ? 0 : cuttingId.hashCode());
		result = prime * result + cuttingQuality;
		result = prime * result + cuttingTime;
		result = prime * result
				+ ((dyeingDate == null) ? 0 : dyeingDate.hashCode());
		result = prime * result
				+ ((dyeingId == null) ? 0 : dyeingId.hashCode());
		result = prime * result + dyeingQuality;
		result = prime * result + dyeingTime;
		result = prime * result
				+ ((finished == null) ? 0 : finished.hashCode());
		result = prime * result + ((order == null) ? 0 : order.hashCode());
		result = prime * result + orderId;
		result = prime * result + ((outcome == null) ? 0 : outcome.hashCode());
		result = prime * result
				+ ((pressingDate == null) ? 0 : pressingDate.hashCode());
		result = prime * result
				+ ((pressingId == null) ? 0 : pressingId.hashCode());
		result = prime * result + pressingQuality;
		result = prime * result + pressingTime;
		result = prime * result + productId;
		result = prime * result
				+ ((sewingDate == null) ? 0 : sewingDate.hashCode());
		result = prime * result
				+ ((sewingId == null) ? 0 : sewingId.hashCode());
		result = prime * result + sewingQuality;
		result = prime * result + sewingTime;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ProductTO other = (ProductTO) obj;
		if (cuttingDate == null) {
			if (other.cuttingDate != null)
				return false;
		} else if (!cuttingDate.equals(other.cuttingDate))
			return false;
		if (cuttingId == null) {
			if (other.cuttingId != null)
				return false;
		} else if (!cuttingId.equals(other.cuttingId))
			return false;
		if (cuttingQuality != other.cuttingQuality)
			return false;
		if (cuttingTime != other.cuttingTime)
			return false;
		if (dyeingDate == null) {
			if (other.dyeingDate != null)
				return false;
		} else if (!dyeingDate.equals(other.dyeingDate))
			return false;
		if (dyeingId == null) {
			if (other.dyeingId != null)
				return false;
		} else if (!dyeingId.equals(other.dyeingId))
			return false;
		if (dyeingQuality != other.dyeingQuality)
			return false;
		if (dyeingTime != other.dyeingTime)
			return false;
		if (finished == null) {
			if (other.finished != null)
				return false;
		} else if (!finished.equals(other.finished))
			return false;
		if (order == null) {
			if (other.order != null)
				return false;
		} else if (!order.equals(other.order))
			return false;
		if (orderId != other.orderId)
			return false;
		if (outcome == null) {
			if (other.outcome != null)
				return false;
		} else if (!outcome.equals(other.outcome))
			return false;
		if (pressingDate == null) {
			if (other.pressingDate != null)
				return false;
		} else if (!pressingDate.equals(other.pressingDate))
			return false;
		if (pressingId == null) {
			if (other.pressingId != null)
				return false;
		} else if (!pressingId.equals(other.pressingId))
			return false;
		if (pressingQuality != other.pressingQuality)
			return false;
		if (pressingTime != other.pressingTime)
			return false;
		if (productId != other.productId)
			return false;
		if (sewingDate == null) {
			if (other.sewingDate != null)
				return false;
		} else if (!sewingDate.equals(other.sewingDate))
			return false;
		if (sewingId == null) {
			if (other.sewingId != null)
				return false;
		} else if (!sewingId.equals(other.sewingId))
			return false;
		if (sewingQuality != other.sewingQuality)
			return false;
		if (sewingTime != other.sewingTime)
			return false;
		return true;
	}
	
}
